<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        div{
            font-size: 40px;
            font-family: 新宋体;
            font-weight: bold;
            color: brown;
            width: 50%;
            border:2px dashed black;
        /*
            1.背景居中:
                margin-left:auto
                margin-right:auto
            2.文本居中:
                text-align:center
        */
            margin-left: auto;
            margin-right: auto;
            text-align: center;
        }
    </style>
</head>
<body>
<div>字体样式</div>
</body>
</html>